feat:完善信息

This commit is contained in:
henry
2021-10-13 14:35:24 +08:00
parent 21dc62ba8e
commit 8866b83cfb
16 changed files with 4728 additions and 46 deletions

View File

@ -43,7 +43,7 @@ func (a *Account) Login(c *gin.Context) {
Password string
}{Mobile: form.Mobile, Password: form.Password},
})
api.APIResponse(err, data)
api.APIResponse(err, data)(c)
}
func (a *Account) Register(c *gin.Context) {
@ -57,7 +57,7 @@ func (a *Account) Register(c *gin.Context) {
Name: form.Name, Mobile: form.Mobile, Captcha: form.Captcha,
Password: form.Password, RepeatPass: form.RepeatPass, Identity: form.Identity,
})
api.APIResponse(err, data)
api.APIResponse(err, data)(c)
}
func (a *Account) BindMobile() {

View File

@ -2,17 +2,34 @@ package api
import (
"SciencesServer/app/basic/api"
"SciencesServer/app/enterprise/controller"
"SciencesServer/app/enterprise/controller/config"
"github.com/gin-gonic/gin"
)
type Config struct{}
func (a *Config) Identity(c *gin.Context) {
data := controller.NewConfig().Identity()
data := config.NewConfig().Identity()
api.APISuccess(data)
}
func (a *Config) Transaction(c *gin.Context) {
data := config.NewConfig().Transaction()
api.APISuccess(data)
}
func (a *Config) Industry(c *gin.Context) {
}
func (a *Config) Area(c *gin.Context) {
form := &struct {
Key string `json:"key" form:"key"`
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
data := config.NewConfig().Area(form.Key)
api.APIResponse(nil, data)(c)
}

View File

@ -33,7 +33,7 @@ func (a *Technology) Paper(c *gin.Context) {
}
data, err := technology.NewPaper()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(uint64)).
List(form.Title, form.Page, form.PageSize)
api.APIResponse(err, data)
api.APIResponse(err, data)(c)
}
func (a *Technology) PaperAdd(c *gin.Context) {
@ -48,7 +48,7 @@ func (a *Technology) PaperAdd(c *gin.Context) {
Title: form.Title, Ext: form.Ext, Author: form.Author, PublishAt: form.PublishAt,
Keyword: form.Keyword, Tags: form.Tags, Remark: form.Remark,
})
api.APIResponse(err)
api.APIResponse(err)(c)
}
func (a *Technology) PaperEdit(c *gin.Context) {
@ -65,7 +65,7 @@ func (a *Technology) PaperEdit(c *gin.Context) {
ID: form.Convert(), Title: form.Title, Ext: form.Ext, Author: form.Author, PublishAt: form.PublishAt,
Keyword: form.Keyword, Tags: form.Tags, Remark: form.Remark,
})
api.APIResponse(err)
api.APIResponse(err)(c)
}
func (a *Technology) PaperDelete(c *gin.Context) {
@ -77,5 +77,5 @@ func (a *Technology) PaperDelete(c *gin.Context) {
}
err := technology.NewPaper()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(uint64)).
Delete(form.Convert())
api.APIResponse(err)
api.APIResponse(err)(c)
}

View File

@ -16,7 +16,7 @@ func (a *User) Info(c *gin.Context) {
func (a *User) Detail(c *gin.Context) {
data, err := user.NewInstance()(api.GetSession()(c).(*service.SessionEnterprise)).Detail()
api.APIResponse(err, data)
api.APIResponse(err, data)(c)
}
func (a *User) SwitchIdentity(c *gin.Context) {
@ -28,5 +28,5 @@ func (a *User) SwitchIdentity(c *gin.Context) {
return
}
err := user.NewInstance()(api.GetSession()(c).(*service.SessionEnterprise)).SwitchIdentity(form.Identity)
api.APIResponse(err)
api.APIResponse(err)(c)
}