后台:跑马灯
This commit is contained in:
@@ -8,13 +8,14 @@ import { DicRMB } from '@pubUtils/dictionary/DicRMB';
|
||||
import { DicActivityType } from '@pubUtils/dictionary/DicActivityType';
|
||||
import { DicTaskType } from '@pubUtils/dictionary/DicTaskType';
|
||||
import { NoticeModel, NoticeTypeParam } from '@db/Notice';
|
||||
import { MarqueeModel, MarqueeParam } from '@db/Marquee';
|
||||
import Marquee, { MarqueeModel } from '@db/Marquee';
|
||||
import { AccuseRecModel } from '@db/AccuseRec';
|
||||
import { RegionModel } from '@db/Region';
|
||||
import { ActivityGroupModel } from '@db/ActivityGroup';
|
||||
import { nowSeconds } from '@pubUtils/timeUtil';
|
||||
import { WhiteListModel } from '@db/RegionWhiteList';
|
||||
import { RoleModel } from '@db/Role';
|
||||
import { SearchMarqueeParam } from '@domain/backEndField/search';
|
||||
|
||||
/**
|
||||
* Test Service
|
||||
@@ -305,21 +306,20 @@ export default class Game extends Service {
|
||||
}
|
||||
|
||||
|
||||
public async getMarqueeList(page: number, pageSize: number, sortField: string, sortOrder: string, form: { type?: number, current?: boolean, content?: string }) {
|
||||
public async getMarqueeList(page: number, pageSize: number, sortField: string, sortOrder: string, form: SearchMarqueeParam) {
|
||||
const { ctx } = this;
|
||||
const list = await MarqueeModel.findByCondition(page, pageSize, sortField, sortOrder, form);
|
||||
const total = await MarqueeModel.countByCondition( form )
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS, {
|
||||
list: list.map(cur => {
|
||||
return { ...cur, startTime: cur.startTime?.getTime()||0, endTime: cur.endTime?.getTime()||0 }
|
||||
}), total
|
||||
list, total
|
||||
});
|
||||
}
|
||||
|
||||
public async updateMarquee(code: string, params: MarqueeParam) {
|
||||
public async updateMarquee(code: string, values: any) {
|
||||
const { ctx } = this;
|
||||
if(params.startTime) params.startTime = new Date(params.startTime);
|
||||
if(params.endTime) params.endTime = new Date(params.endTime);
|
||||
let params = new Marquee();
|
||||
params.setByForm(values);
|
||||
|
||||
let result;
|
||||
if(code == 'new') {
|
||||
result = await MarqueeModel.createData(params);
|
||||
@@ -327,7 +327,7 @@ export default class Game extends Service {
|
||||
result = await MarqueeModel.updateData(code, params);
|
||||
}
|
||||
if(!result) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS);
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS, { code: result.code });
|
||||
}
|
||||
|
||||
public async getAccuse(page: number, pageSize: number, sortField: string, sortOrder: string, form: {}) {
|
||||
|
||||
Reference in New Issue
Block a user