feat:完善项目信息
This commit is contained in:
47
app/basic/api/config.go
Normal file
47
app/basic/api/config.go
Normal file
@ -0,0 +1,47 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"SciencesServer/app/basic/controller"
|
||||
"SciencesServer/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type Config struct{}
|
||||
|
||||
func (*Config) Identity(c *gin.Context) {
|
||||
data := controller.NewConfig().Identity()
|
||||
APISuccess(data)(c)
|
||||
}
|
||||
|
||||
func (a *Config) Transaction(c *gin.Context) {
|
||||
data := controller.NewConfig().Transaction()
|
||||
APISuccess(data)(c)
|
||||
}
|
||||
|
||||
func (a *Config) Industry(c *gin.Context) {
|
||||
form := &struct {
|
||||
ParentID string `json:"parent_id" form:"parent_id"`
|
||||
}{}
|
||||
if err := Bind(form)(c); err != nil {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data := controller.NewConfig().Industry(utils.StringToUnit64(form.ParentID))
|
||||
APISuccess(data)(c)
|
||||
}
|
||||
|
||||
func (a *Config) Research(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
||||
func (a *Config) Area(c *gin.Context) {
|
||||
form := &struct {
|
||||
Code string `json:"code" form:"code"`
|
||||
}{}
|
||||
if err := Bind(form)(c); err != nil {
|
||||
APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data := controller.NewConfig().Area(form.Code)
|
||||
APIResponse(nil, data)(c)
|
||||
}
|
Reference in New Issue
Block a user