48 lines
977 B
Go
48 lines
977 B
Go
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)
|
|
}
|