Commit c624c74a authored by haoyanbin's avatar haoyanbin

1

parent ba19a872
...@@ -68,9 +68,10 @@ func (e OrgPlayer) GetPage(c *gin.Context) { ...@@ -68,9 +68,10 @@ func (e OrgPlayer) GetPage(c *gin.Context) {
func (e OrgPlayer) Get(c *gin.Context) { func (e OrgPlayer) Get(c *gin.Context) {
req := dto.OrgPlayerGetReq{} req := dto.OrgPlayerGetReq{}
s := service.OrgPlayer{} s := service.OrgPlayer{}
err := c.Bind(&req) //err := c.Bind(&req)
err = e.MakeContext(c). err := e.MakeContext(c).
MakeOrm(). MakeOrm().
Bind(&req).
MakeService(&s.Service). MakeService(&s.Service).
Errors Errors
if err != nil { if err != nil {
...@@ -133,14 +134,14 @@ func (e OrgPlayer) Get(c *gin.Context) { ...@@ -133,14 +134,14 @@ func (e OrgPlayer) Get(c *gin.Context) {
// @Tags <手机端>球员数据 // @Tags <手机端>球员数据
// @Param playerId path string false "playerId" // @Param playerId path string false "playerId"
// @Success 200 {string} string "{"code": 200, "data": [...]}" // @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /mobile/v1/org-player/info [get] // @Router /mobile/v1/org-player/info/{id} [get]
// @Security Bearer // @Security Bearer
func (e OrgPlayer) GetInfo(c *gin.Context) { func (e OrgPlayer) GetInfo(c *gin.Context) {
req := dto.OrgPlayerGetReq{} req := dto.OrgPlayerGetReq{}
s := service.OrgPlayer{} s := service.OrgPlayer{}
err := c.Bind(&req) err := e.MakeContext(c).
err = e.MakeContext(c).
MakeOrm(). MakeOrm().
Bind(&req).
MakeService(&s.Service). MakeService(&s.Service).
Errors Errors
if err != nil { if err != nil {
...@@ -190,14 +191,14 @@ func (e OrgPlayer) GetInfo(c *gin.Context) { ...@@ -190,14 +191,14 @@ func (e OrgPlayer) GetInfo(c *gin.Context) {
// @Tags <手机端>球员数据 // @Tags <手机端>球员数据
// @Param playerId path string false "playerId" // @Param playerId path string false "playerId"
// @Success 200 {string} string "{"code": 200, "data": [...]}" // @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /mobile/v1/org-player/get-match-season [get] // @Router /mobile/v1/org-player/get-match-season/{id} [get]
// @Security Bearer // @Security Bearer
func (e OrgPlayer) GetOrgMatchSeason(c *gin.Context) { func (e OrgPlayer) GetOrgMatchSeason(c *gin.Context) {
req := dto.OrgPlayerGetReq{} req := dto.OrgPlayerGetReq{}
s := service.OrgPlayer{} s := service.OrgPlayer{}
err := c.Bind(&req) err := e.MakeContext(c).
err = e.MakeContext(c).
MakeOrm(). MakeOrm().
Bind(&req).
MakeService(&s.Service). MakeService(&s.Service).
Errors Errors
if err != nil { if err != nil {
......
...@@ -16,8 +16,8 @@ func registerOrgPlayerRouter(v1 *gin.RouterGroup) { ...@@ -16,8 +16,8 @@ func registerOrgPlayerRouter(v1 *gin.RouterGroup) {
{ {
r.GET("", api.GetPage) r.GET("", api.GetPage)
r.GET("/:id", api.Get) r.GET("/:id", api.Get)
r.GET("/info", api.GetInfo) r.GET("/info/:id", api.GetInfo)
r.GET("/get-match-season", api.GetOrgMatchSeason) r.GET("/get-match-season/:id", api.GetOrgMatchSeason)
r.GET("/evaluate", api.GetOrgMatchEvaluate) r.GET("/evaluate", api.GetOrgMatchEvaluate)
r.GET("/get-rounds", api.GetOrgRounds) r.GET("/get-rounds", api.GetOrgRounds)
} }
......
...@@ -139,7 +139,7 @@ type OrgMatchEvaluateList struct { ...@@ -139,7 +139,7 @@ type OrgMatchEvaluateList struct {
// OrgPlayerGetReq 功能获取请求参数 // OrgPlayerGetReq 功能获取请求参数
type OrgPlayerGetReq struct { type OrgPlayerGetReq struct {
PlayerId int `form:"playerId" json:"playerId"` PlayerId int `uri:"id"`
} }
type OrgPlayerGetReply struct { type OrgPlayerGetReply struct {
......
...@@ -92,7 +92,7 @@ func (e *OrgPlayer) GetData(d *dto.OrgPlayerDataGetReq, p *actions.DataPermissio ...@@ -92,7 +92,7 @@ func (e *OrgPlayer) GetData(d *dto.OrgPlayerDataGetReq, p *actions.DataPermissio
func (e *OrgPlayer) GetDataSeason(d *dto.OrgPlayerDataGetReq, p *actions.DataPermission, model *dto.OrgPlayerDataGetReply) error { func (e *OrgPlayer) GetDataSeason(d *dto.OrgPlayerDataGetReq, p *actions.DataPermission, model *dto.OrgPlayerDataGetReply) error {
var err error var err error
field := "count(om.id) as count_match" field := "count(om.id) as scoring"
err = e.Orm.Table("org_match_team_player as omtp"). err = e.Orm.Table("org_match_team_player as omtp").
Select(field). Select(field).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment