后台:公告列表
This commit is contained in:
@@ -8,6 +8,7 @@ import { DicRMB } from '@pubUtils/dictionary/DicRMB';
|
||||
import { DicActivityType } from '@pubUtils/dictionary/DicActivityType';
|
||||
import { DicTaskType } from '@pubUtils/dictionary/DicTaskType';
|
||||
import { ServerStategyModel, ServerStategyTypeParam } from '@db/ServerStategy';
|
||||
import { NoticeModel, NoticeTypeParam } from '@db/Notice';
|
||||
|
||||
/**
|
||||
* Test Service
|
||||
@@ -157,4 +158,27 @@ export default class Game extends Service {
|
||||
list
|
||||
})
|
||||
}
|
||||
|
||||
public async getNoticeList(page: number, pageSize: number, sortField: string, sortOrder: string, form: { type?: number, content?: string }) {
|
||||
const { ctx } = this;
|
||||
const list = await NoticeModel.findByCondition(page, pageSize, sortField, sortOrder, form);
|
||||
const total = await NoticeModel.countByCondition( form )
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS, {
|
||||
list, total
|
||||
});
|
||||
}
|
||||
|
||||
public async updateNotice(id: string|number, params: NoticeTypeParam) {
|
||||
const { ctx } = this;
|
||||
let result = await NoticeModel.updateNotice(id, params);
|
||||
if(!result) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
public async delNotice(id: number) {
|
||||
const { ctx } = this;
|
||||
let result = await NoticeModel.delNotice(id);
|
||||
if(!result) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user