店铺信息增加额外参数, 增加sysmail的定义

This commit is contained in:
zhl 2021-06-08 11:22:57 +08:00
parent 280a8251b7
commit f74a27ca41
2 changed files with 23 additions and 1 deletions

View File

@ -82,7 +82,11 @@ class ShopController extends BaseController {
@router('post /api/:accountid/shop') @router('post /api/:accountid/shop')
async shopInfo(req) { async shopInfo(req) {
let { sid } = req.params let { sid } = req.params
if (!sid || !validShopId(sid)) { if (!sid) {
throw new ZError(10, `shopInfo 没有店铺id: ${sid}`)
}
sid = sid.split('|')[0]
if (!validShopId(sid)) {
throw new ZError(10, `shopInfo 没有店铺id或者店铺id格式不正确: ${sid}`) throw new ZError(10, `shopInfo 没有店铺id或者店铺id格式不正确: ${sid}`)
} }
let rspData: any = {} let rspData: any = {}

View File

@ -0,0 +1,18 @@
import { dbconn } from '../../decorators/dbconn'
import { getModelForClass, modelOptions, prop } from '@typegoose/typegoose'
import { Severity } from '@typegoose/typegoose/lib/internal/constants'
import { BaseModule } from '../Base'
@dbconn()
@modelOptions({
schemaOptions: { collection: 'sys_mail', timestamps: true },
options: { allowMixed: Severity.ALLOW },
})
export class SysMailClass extends BaseModule {
@prop()
public title: string
@prop()
public content: string
}
export const SysMail = getModelForClass(SysMailClass, { existingConnection: SysMailClass.db })