feat:完善项目信息
This commit is contained in:
@ -3,33 +3,13 @@ package api
|
||||
import (
|
||||
"SciencesServer/app/api/enterprise/controller/user"
|
||||
"SciencesServer/app/basic/api"
|
||||
"SciencesServer/app/basic/config"
|
||||
"SciencesServer/app/session"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type User struct{}
|
||||
|
||||
type (
|
||||
// userSettledForm 入驻平台参数
|
||||
userSettledForm struct {
|
||||
api.ImageForm
|
||||
Name string `json:"name" form:"name"`
|
||||
Code string `json:"code" form:"code"`
|
||||
config.Area
|
||||
Introduce string `json:"introduce" form:"introduce"`
|
||||
Industrys []string `json:"industrys" form:"industrys"` // 行业领域
|
||||
Keywords []string `json:"keywords" form:"keywords"`
|
||||
}
|
||||
// userBankForm 银行平台信息参数
|
||||
userBankForm struct {
|
||||
Name string `json:"name" form:"name" binding:"required"`
|
||||
IDCard string `json:"id_card" form:"id_card" binding:"required"`
|
||||
BackCard string `json:"back_card" form:"back_card" binding:"required"`
|
||||
BackName string `json:"back_name" form:"back_name" binding:"required"`
|
||||
Captcha string `json:"captcha" form:"captcha" binding:"required"`
|
||||
}
|
||||
)
|
||||
type ()
|
||||
|
||||
func (*User) Info(c *gin.Context) {
|
||||
data := user.NewInstance()(api.GetSession()(c).(*session.Enterprise)).Info()
|
||||
@ -73,12 +53,17 @@ func (*User) IdentitySwitch(c *gin.Context) {
|
||||
|
||||
func (*User) Back(c *gin.Context) {
|
||||
data, err := user.NewBank()(api.GetSession()(c).(*session.Enterprise)).List()
|
||||
api.APIResponse(err, data)
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*User) BackBind(c *gin.Context) {
|
||||
form := new(userBankForm)
|
||||
|
||||
form := &struct {
|
||||
Name string `json:"name" form:"name" binding:"required"`
|
||||
IDCard string `json:"id_card" form:"id_card" binding:"required"`
|
||||
BackCard string `json:"back_card" form:"back_card" binding:"required"`
|
||||
BackName string `json:"back_name" form:"back_name" binding:"required"`
|
||||
Captcha string `json:"captcha" form:"captcha" binding:"required"`
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
@ -86,7 +71,7 @@ func (*User) BackBind(c *gin.Context) {
|
||||
err := user.NewBank()(api.GetSession()(c).(*session.Enterprise)).Bind(&user.BankParams{
|
||||
Name: form.Name, IDCard: form.IDCard, BankCard: form.BackCard, BankName: form.BackName,
|
||||
}, form.Captcha)
|
||||
api.APIResponse(err)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*User) BackUnbind(c *gin.Context) {
|
||||
@ -97,16 +82,52 @@ func (*User) BackUnbind(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
err := user.NewBank()(api.GetSession()(c).(*session.Enterprise)).Unbind(form.Convert())
|
||||
api.APIResponse(err)
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*User) Patent(c *gin.Context) {
|
||||
func (*User) Bill(c *gin.Context) {
|
||||
form := &struct {
|
||||
Title string `json:"title" form:"title"`
|
||||
OrderNo string `json:"order_no" form:"order_no"`
|
||||
CreatedAt string `json:"created_at" form:"created_at"`
|
||||
api.PageForm
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := user.NewBill()(api.GetSession()(c).(*session.Enterprise)).Instance(form.OrderNo, form.CreatedAt,
|
||||
form.Page, form.PageSize)
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*User) BillTicket(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
data, err := user.NewBill()(api.GetSession()(c).(*session.Enterprise)).Ticket(form.Convert())
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*User) BillTicketIssue(c *gin.Context) {
|
||||
form := &struct {
|
||||
api.IDStringForm
|
||||
Kind int `json:"kind" form:"kind" binding:"required"`
|
||||
Name string `json:"name" form:"name" binding:"required"`
|
||||
DutyParagraph string `json:"duty_paragraph" form:"duty_paragraph" binding:"required"`
|
||||
Mobile string `json:"mobile" form:"mobile" binding:"required"`
|
||||
Email string `json:"email" form:"email" binding:"required"`
|
||||
Address string `json:"address" form:"address"`
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := user.NewBill()(api.GetSession()(c).(*session.Enterprise)).TicketIssue(form.Convert(), &user.BillTicketParams{
|
||||
Kind: form.Kind, Name: form.Name, DutyParagraph: form.DutyParagraph, Mobile: form.Mobile,
|
||||
Email: form.Email, Address: form.Address,
|
||||
})
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
Reference in New Issue
Block a user