/*
 * @Author: YKH
 * @Date: 2022-04-14 11:46:16
 * @LastEditTime: 2022-06-14 15:41:49
 * @Description: 
 * @FilePath: \cool-admin\cool-admin-midway-master\src\app\modules\shuyou\controller\admin\robot_enterprise_wechat.ts
 */
import { Provide } from '@midwayjs/decorator';
import { CoolController, BaseController } from 'midwayjs-cool-core';
import { SyRobotEnterpriseWeChatEntity } from '../../entity/robot_enterprise_wechat';
import { SyRobotEnterpriseWeChatService } from '../../service/robot_enterprise_wechat';

/**
 * 
 */
@Provide()
@CoolController({
  // 添加通用CRUD接口
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  // 设置表实体
  entity: SyRobotEnterpriseWeChatEntity,
  service: SyRobotEnterpriseWeChatService,

  before: ctx => {
    //前段数据转JSON格式
    // const data = ctx.request.body;
    // console.log(data)
    // console.log(data.status)
    // if (data.status == "") {
    //   data.status = 1
    // }
    // // console.log(data.status)
    // ctx.request.body.data = JSON.stringify(data);
  },
  // 分页查询配置
  pageQueryOp: {
    // 让字段支持模糊查询
    keyWordLikeFields: ['name'],
    // 让字段支持筛选
    fieldEq: ['name'],
    // 添加排序
    addOrderBy: {
      // 排序字段及排序方式
      name: 'asc',
    },
  },
})
export class SyRobotEnterpriseWeChatController extends BaseController {

}
