achievement.go 823 字节
package controllers

import (
	"encoding/json"
	"oppmg/common/log"
	"oppmg/protocol"
	serveachievement "oppmg/services/achievement"
)

type AchievementController struct {
	BaseController
}

//List 成果列表
//@router /achievement/list
func (c AchievementController) List() {
	var msg *protocol.ResponseMessage
	defer func() {
		c.ResposeJson(msg)
	}()
	type Parameter struct {
		protocol.RequestPageInfo
		Status int `json:"status"`
	}
	var param Parameter
	if err := json.Unmarshal(c.Ctx.Input.RequestBody, &param); err != nil {
		log.Error("json 解析失败 err:%s", err)
		msg = protocol.BadRequestParam("1")
		return
	}
	companyid := c.GetCompanyId()
	rspdata := serveachievement.GetAchievementList(param.PageIndex, param.PageSize, companyid, param.Status)
	msg = protocol.NewReturnResponse(rspdata, nil)
	return
}