audit.go 916 字节
package controllers

import (
	"encoding/json"
	"oppmg/common/log"
	"oppmg/protocol"
	serveaudit "oppmg/services/audit"
)

type AuditController struct {
	BaseController
}

//AuditList 机会管理列表
//@router /v1/audit/list [post]
func (c *AuditController) AuditList() {
	var msg *protocol.ResponseMessage
	defer func() {
		c.ResposeJson(msg)
	}()
	var param protocol.RequestAuditList
	if err := json.Unmarshal(c.Ctx.Input.RequestBody, &param); err != nil {
		log.Error("json 解析失败", err)
		msg = protocol.BadRequestParam("1")
		return
	}
	uid := c.GetUserId()
	companyId := c.GetCompanyId()
	list, err := serveaudit.GetAuditList(param, companyId, uid)
	msg = protocol.NewReturnResponse(list, err)
	return
}

// func (c *AuditController) Test() {
// 	data, err := serverbac.GetUserPermission(11)
// 	fmt.Println(err)
// 	bt, err := json.Marshal(data)
// 	fmt.Println(err)
// 	fmt.Println(string(bt))
// }