补充公告与试题中心RPC契约,DataService补考试类型与科目增删改方法
This commit is contained in:
33
src/NoticeService/NoticeAttachmentInterface.php
Normal file
33
src/NoticeService/NoticeAttachmentInterface.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticeAttachmentInterface
|
||||
{
|
||||
/**
|
||||
* 根据公告ID获取附件列表
|
||||
*/
|
||||
public function getByNoticeId(int $noticeId): array;
|
||||
|
||||
/**
|
||||
* 批量创建附件
|
||||
*/
|
||||
public function batchCreate(int $noticeId, array $attachments): bool;
|
||||
|
||||
/**
|
||||
* 删除公告的所有附件
|
||||
*/
|
||||
public function deleteByNoticeId(int $noticeId): bool;
|
||||
|
||||
/**
|
||||
* 删除单个附件
|
||||
*/
|
||||
public function delete(int $id): bool;
|
||||
|
||||
/**
|
||||
* 增加下载次数
|
||||
*/
|
||||
public function incrementDownloadCount(int $id): bool;
|
||||
}
|
||||
24
src/NoticeService/NoticePositionCollectInterface.php
Normal file
24
src/NoticeService/NoticePositionCollectInterface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticePositionCollectInterface
|
||||
{
|
||||
/**
|
||||
* 获取职位收藏列表
|
||||
* @param int $userId 用户ID
|
||||
* @param array $params 参数
|
||||
* @return array
|
||||
*/
|
||||
public function getPositionCollectList(int $userId, array $params): array;
|
||||
|
||||
/**
|
||||
* 职位收藏/取消收藏
|
||||
* @param int $userId 用户ID
|
||||
* @param int $positionId 职位ID
|
||||
* @return string
|
||||
*/
|
||||
public function positionCollect(int $userId, int $positionId): string;
|
||||
}
|
||||
82
src/NoticeService/NoticePositionHistoryInterface.php
Normal file
82
src/NoticeService/NoticePositionHistoryInterface.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticePositionHistoryInterface
|
||||
{
|
||||
public function getPositionHistoryGroups(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取岗位历史数据列表
|
||||
* @param array $params 查询参数
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionHistoryList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取岗位历史数据详情
|
||||
* @param int $id 岗位历史数据id
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionHistoryDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 获取岗位历史数据年份列表
|
||||
* @param string $originUnitName 岗位名称
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionHistoryYearList(string $originUnitName): array;
|
||||
|
||||
/**
|
||||
* 获取岗位历史数据考区列表
|
||||
* @param string $originUnitName 岗位名称
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionHistoryExamCityList(string $originUnitName): array;
|
||||
|
||||
/**
|
||||
* app端获取岗位历史数据列表
|
||||
* @param array $params
|
||||
* @param int $userId 用户ID
|
||||
* @return array
|
||||
*/
|
||||
public function appGetNoticePositionHistoryList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* app端获取岗位历史数据详情
|
||||
* @param array $ids
|
||||
* @param int $userId
|
||||
* @return array
|
||||
*/
|
||||
public function appGetNoticePositionHistoryDetail(array $ids, int $userId): array;
|
||||
|
||||
/**
|
||||
* 编辑/创建岗位历史数据
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function editNoticePositionHistory(array $params): bool;
|
||||
|
||||
/**
|
||||
* 批量导入岗位历史数据
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function importNoticePositionHistory(array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除岗位历史数据
|
||||
* @param int $id 岗位历史数据id
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteNoticePositionHistory(int $id): bool;
|
||||
|
||||
/**
|
||||
* 清空岗位
|
||||
* @param array $params 参数
|
||||
* @return bool
|
||||
*/
|
||||
public function cleanNoticePositionHistory(array $params): bool;
|
||||
}
|
||||
80
src/NoticeService/NoticePositionInterface.php
Normal file
80
src/NoticeService/NoticePositionInterface.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticePositionInterface
|
||||
{
|
||||
/**
|
||||
* 获取岗位列表
|
||||
* @param array $params 查询参数
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionList(array $params): array;
|
||||
|
||||
/**
|
||||
* 获取岗位详情
|
||||
* @param int $id 岗位id
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionDetail(int $id): array;
|
||||
|
||||
/**
|
||||
* 编辑/创建岗位,若公告ID、单位名称、岗位名称对应的记录存在则进行编辑,否则进行创建
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function editNoticePosition(array $params): bool;
|
||||
|
||||
/**
|
||||
* 批量导入岗位
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public function importNoticePosition(array $params): bool;
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
* @param int $id 岗位id
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteNoticePosition(int $id): bool;
|
||||
|
||||
/**
|
||||
* app端获取岗位列表
|
||||
* @param array $params
|
||||
* @param int $userId 用户ID
|
||||
* @return array
|
||||
*/
|
||||
public function appGetNoticePositionList(array $params, int $userId): array;
|
||||
|
||||
/**
|
||||
* app端获取岗位详情
|
||||
* @param array $ids
|
||||
* @param int $userId
|
||||
* @return array
|
||||
*/
|
||||
public function appGetNoticePositionDetail(array $ids, int $userId): array;
|
||||
|
||||
/**
|
||||
* 获取公告岗位城市下拉树
|
||||
* @param int $noticeId 公告ID
|
||||
* @return array
|
||||
*/
|
||||
public function getNoticePositionCityList(int $noticeId): array;
|
||||
|
||||
/**
|
||||
* 清空岗位
|
||||
* @param int $noticeId 公告ID
|
||||
* @return bool
|
||||
*/
|
||||
public function cleanNoticePosition(int $noticeId): bool;
|
||||
|
||||
/**
|
||||
* 更新岗位信息
|
||||
* @param array $params 参数
|
||||
* @return bool
|
||||
*/
|
||||
public function updatePositionInfo(array $params): bool;
|
||||
}
|
||||
24
src/NoticeService/NoticePositionPkInterface.php
Normal file
24
src/NoticeService/NoticePositionPkInterface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticePositionPkInterface
|
||||
{
|
||||
/**
|
||||
* 获取职位Pk列表
|
||||
* @param int $userId 用户ID
|
||||
* @param array $params 参数
|
||||
* @return array
|
||||
*/
|
||||
public function getPositionPkList(int $userId, array $params): array;
|
||||
|
||||
/**
|
||||
* 职位Pk/取消Pk
|
||||
* @param int $userId 用户ID
|
||||
* @param int $positionId 职位ID
|
||||
* @return int
|
||||
*/
|
||||
public function positionPk(int $userId, int $positionId): int;
|
||||
}
|
||||
20
src/NoticeService/NoticeService.php
Normal file
20
src/NoticeService/NoticeService.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
/**
|
||||
* 公告中心聚合契约
|
||||
*/
|
||||
interface NoticeService extends
|
||||
NoticeServiceInterface,
|
||||
NoticePositionInterface,
|
||||
NoticePositionHistoryInterface,
|
||||
NoticePositionCollectInterface,
|
||||
NoticePositionPkInterface,
|
||||
NoticeAttachmentInterface,
|
||||
NoticeStatsInterface,
|
||||
NoticeStatsLogInterface
|
||||
{
|
||||
}
|
||||
109
src/NoticeService/NoticeServiceInterface.php
Normal file
109
src/NoticeService/NoticeServiceInterface.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticeServiceInterface
|
||||
{
|
||||
// 公告管理
|
||||
public function getList(array $params): array;
|
||||
|
||||
public function appGetNoticeTypes(int $regionId = 0): array;
|
||||
|
||||
public function appGetList(array $params): array;
|
||||
|
||||
public function officialGetList(array $params): array;
|
||||
|
||||
public function officialGetAllList(array $params): array;
|
||||
|
||||
public function adminGetList(array $params): array;
|
||||
|
||||
public function detail(int $id, ?int $userId = null): array;
|
||||
|
||||
public function create(array $data): int;
|
||||
|
||||
public function update(int $id, array $data): bool;
|
||||
|
||||
public function delete(int $id): bool;
|
||||
|
||||
public function changeStatus(int $id, int $status): bool;
|
||||
|
||||
public function toggleTop(int $id, bool $isTop): bool;
|
||||
|
||||
// 附件管理
|
||||
public function getAttachmentsByNoticeId(int $noticeId): array;
|
||||
|
||||
public function batchCreateAttachments(int $noticeId, array $attachments): bool;
|
||||
|
||||
public function deleteNoticeAttachments(int $noticeId): bool;
|
||||
|
||||
public function deleteAttachment(int $id): bool;
|
||||
|
||||
public function incrementAttachmentDownload(int $id): bool;
|
||||
|
||||
// 点赞收藏
|
||||
public function like(int $noticeId, int $userId): array;
|
||||
public function unLike(int $noticeId, int $userId): array;
|
||||
public function collect(int $noticeId, int $userId): array;
|
||||
public function unCollect(int $noticeId, int $userId): array;
|
||||
|
||||
public function userCollectedNotices(int $userId, array $params): array;
|
||||
|
||||
// 统计日志
|
||||
public function logNoticeView(int $noticeId): void;
|
||||
|
||||
public function logNoticeShare(int $noticeId): void;
|
||||
|
||||
public function logNoticeLike(int $noticeId): void;
|
||||
|
||||
public function logNoticeCancelLike(int $noticeId): void;
|
||||
|
||||
public function logAttachmentDownload(int $noticeId, int $attachmentId): void;
|
||||
|
||||
public function getNoticeStatsLogs(int $noticeId, array $params = []): array;
|
||||
|
||||
public function searchNotices(string $keyword, array $params = []): array;
|
||||
|
||||
public function getChildNotices(int $parentId, array $params = []): array;
|
||||
|
||||
public function attachChildNotices(int $parentId, array $childIds): bool;
|
||||
|
||||
public function detachChildNotices(int $parentId, array $childIds): bool;
|
||||
|
||||
public function getNoticeCalendar(int $year, int $month, int $campusId = 0, int $typeId = 0, int $maxRows = 5): array;
|
||||
|
||||
// 官网备考倒计时
|
||||
public function getExamCountdowns(array $params): array;
|
||||
public function getExamCountdownById(int $id): array;
|
||||
public function createExamCountdown(array $data): int;
|
||||
public function updateExamCountdown(int $id, array $data): bool;
|
||||
public function deleteExamCountdown(int $id): bool;
|
||||
public function changeExamCountdownStatus(int $id, int $status): bool;
|
||||
public function officialGetExamCountdowns(): array;
|
||||
|
||||
// 招考指南
|
||||
public function getStageOptions(): array;
|
||||
|
||||
public function getExamYears(int $typeId = 0, int $campusId = 0): array;
|
||||
|
||||
public function getExamTimeline(int $noticeId = 0, int $typeId = 0, int $examYear = 0, int $campusId = 0): array;
|
||||
|
||||
/**
|
||||
* 按年份分组获取所有主公告及其时间轴
|
||||
*
|
||||
* 返回结构:
|
||||
* [
|
||||
* ['year' => 2025, 'notices' => [
|
||||
* ['notice_id'=>1, 'title'=>'...', 'campus_id'=>5, 'timeline'=>[...]]
|
||||
* ]],
|
||||
* ]
|
||||
*/
|
||||
public function getTimelinesByYear(int $typeId = 0, int $campusId = 0): array;
|
||||
|
||||
public function getTimelineCampuses(int $typeId, int $examYear): array;
|
||||
|
||||
public function getNoticesByYear(array $params): array;
|
||||
|
||||
public function getRelatedNotices(int $noticeId): array;
|
||||
}
|
||||
12
src/NoticeService/NoticeStatsInterface.php
Normal file
12
src/NoticeService/NoticeStatsInterface.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
/**
|
||||
* 公告统计聚合契约(空,预留)
|
||||
*/
|
||||
interface NoticeStatsInterface
|
||||
{
|
||||
}
|
||||
26
src/NoticeService/NoticeStatsLogInterface.php
Normal file
26
src/NoticeService/NoticeStatsLogInterface.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dhd\Micro\Interface\NoticeService;
|
||||
|
||||
interface NoticeStatsLogInterface
|
||||
{
|
||||
// 记录浏览日志
|
||||
public function logView(int $noticeId): int;
|
||||
|
||||
// 记录分享日志
|
||||
public function logShare(int $noticeId): int;
|
||||
|
||||
// 记录点赞日志
|
||||
public function logLike(int $noticeId): int;
|
||||
|
||||
// 记录取消点赞日志
|
||||
public function logCancelLike(int $noticeId): int;
|
||||
|
||||
// 记录下载日志
|
||||
public function logDownload(int $noticeId, int $attachmentId): int;
|
||||
|
||||
// 获取公告的统计日志
|
||||
public function getLogsByNoticeId(int $noticeId, array $params = []): array;
|
||||
}
|
||||
Reference in New Issue
Block a user