作者 yangfu

权限修改

... ... @@ -208,24 +208,24 @@ func (this *ChanceController) ChanceType() {
//Permission 机会权限
//@router /permission [post]
func (this *ChanceController) Permission() {
var msg *protocol.ResponseMessage
defer func() {
this.Resp(msg)
}()
var request *protocol.ChancePermissionRequest
if err := json.Unmarshal(this.ByteBody, &request); err != nil {
log.Error(err)
msg = protocol.BadRequestParam(1)
return
}
if b, m := this.Valid(request); !b {
msg = m
return
}
header := controllers.GetRequestHeader(this.Ctx)
msg = protocol.NewReturnResponse(chance.ChancePermission(header, request))
}
//func (this *ChanceController) Permission() {
// var msg *protocol.ResponseMessage
// defer func() {
// this.Resp(msg)
// }()//
// var request *protocol.ChancePermissionRequest
// if err := json.Unmarshal(this.ByteBody, &request); err != nil {
// log.Error(err)
// msg = protocol.BadRequestParam(1)
// return
// }
// if b, m := this.Valid(request); !b {
// msg = m
// return
// }
// header := controllers.GetRequestHeader(this.Ctx)
// msg = protocol.NewReturnResponse(chance.ChancePermission(header, request))
//}
//Templates
//@router /templates [post]
... ...
... ... @@ -173,14 +173,14 @@ type ChancePoolResponse struct {
}
/*Permission 机会权限*/
type ChancePermissionRequest struct {
}
type ChancePermissionResponse struct {
EditScore int `json:"editScore"`
EditChance int `json:"editChance"`
EditPublic int `json:"editPublic"`
CloseChance int `json:"closeChance"`
}
//type ChancePermissionRequest struct {
//}
//type ChancePermissionResponse struct {
// EditScore int `json:"editScore"`
// EditChance int `json:"editChance"`
// EditPublic int `json:"editPublic"`
// CloseChance int `json:"closeChance"`
//}
//我的机会列表
type ChanceItemOrm struct {
... ...
... ... @@ -209,14 +209,6 @@ func init() {
beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
beego.ControllerComments{
Method: "Permission",
Router: `/permission`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Params: nil})
beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"] = append(beego.GlobalControllerRouter["opp/controllers/v1:ChanceController"],
beego.ControllerComments{
Method: "ChanceStatistics",
Router: `/statistics`,
AllowHTTPMethods: []string{"post"},
... ...
... ... @@ -915,17 +915,17 @@ func ChanceCalculateDefautlScore(header *protocol.RequestHeader) (rsp protocol.S
}
//机会权限
func ChancePermission(header *protocol.RequestHeader, request *protocol.ChancePermissionRequest) (rsp *protocol.ChancePermissionResponse, err error) {
var ()
rsp = &protocol.ChancePermissionResponse{}
{
rsp.EditChance = 1
rsp.EditScore = 1
rsp.EditPublic = 1
rsp.CloseChance = 1
}
return
}
//func ChancePermission(header *protocol.RequestHeader, request *protocol.ChancePermissionRequest) (rsp *protocol.ChancePermissionResponse, err error) {
// var ()
// rsp = &protocol.ChancePermissionResponse{}
// {
// rsp.EditChance = 1
// rsp.EditScore = 1
// rsp.EditPublic = 1
// rsp.CloseChance = 1
// }
// return
//}
//生成审批流-提交记录
func GenAuditFlowProcess_Submit(userId, chanceId int64, templateId int64, reviewStatus int) (v *models.AuditFlowProcess) {
... ...