feat:优化项目结构

This commit is contained in:
henry
2021-11-24 10:50:09 +08:00
parent f007168919
commit 0862142ef0
25 changed files with 306 additions and 203 deletions

View File

@ -1,8 +1,11 @@
package api
import (
account2 "SciencesServer/app/api/enterprise/controller/account"
"SciencesServer/app/api/enterprise/controller/account"
"SciencesServer/app/basic/api"
"SciencesServer/app/service"
"SciencesServer/app/session"
"SciencesServer/config"
"github.com/gin-gonic/gin"
)
@ -32,7 +35,7 @@ func (a *Account) Login(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := account2.NewLogin()(api.GetLocal()(c).(string)).Launch(account2.LoginMode(form.Mode), &account2.LoginParams{
data, err := account.NewLogin()(api.GetLocal()(c).(string)).Launch(account.LoginMode(form.Mode), &account.LoginParams{
Captcha: struct {
Mobile string
Captcha string
@ -52,7 +55,7 @@ func (a *Account) Register(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := account2.NewRegister()(api.GetLocal()(c).(string)).Launch(&account2.RegisterParams{
data, err := account.NewRegister()(api.GetLocal()(c).(string)).Launch(&account.RegisterParams{
Name: form.Name, Mobile: form.Mobile, Captcha: form.Captcha,
Password: form.Password, RepeatPass: form.RepeatPass, Identity: form.Identity,
})
@ -63,16 +66,14 @@ func (*Account) Authorize(c *gin.Context) {
}
func (*Account) BindMobile(c *gin.Context) {
//account.NewOther()().BindMobile()
}
func (*Account) Logout(c *gin.Context) {
// 因跳过中间键故只能自己去获取token用户信息
//token := c.GetHeader(config.APIRequestToken)
token := c.GetHeader(config.APIRequestToken)
//session, _ := service.NewAuthToken(token).Auth()
_session := session.NewEnterprise()
err := account2.NewLogout()(nil).Launch()
_ = service.NewAuthToken(token).Auth(_session)
err := account.NewLogout()(_session).Launch()
api.APIResponse(err)(c)
}

View File

@ -3,7 +3,7 @@ package api
import (
"SciencesServer/app/api/enterprise/controller/identity"
"SciencesServer/app/basic/api"
"SciencesServer/app/service"
"SciencesServer/app/session"
"github.com/gin-gonic/gin"
)
@ -19,7 +19,7 @@ func (*Identity) Expert(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := identity.NewInstance()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
data, err := identity.NewInstance()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Expert(form.Name, form.Mobile, form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}

View File

@ -4,7 +4,7 @@ import (
technology2 "SciencesServer/app/api/enterprise/controller/technology"
"SciencesServer/app/basic/api"
"SciencesServer/app/basic/config"
"SciencesServer/app/service"
"SciencesServer/app/session"
config2 "SciencesServer/config"
"github.com/gin-gonic/gin"
"strings"
@ -110,7 +110,7 @@ func (a *Technology) Instance(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := technology2.NewInstance()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
data, err := technology2.NewInstance()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
List(form.Status, form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}
@ -122,7 +122,7 @@ func (a *Technology) InstanceAdd(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewInstance()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewInstance()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.InstanceParams{
PatentID: form.PatentID, Territory: form.Territory, Title: form.Title, Company: form.Company,
Images: form.FilterImageURL(), ProveImages: form.FilterProveImages(), Introduce: form.Introduce, Purpose: form.Purpose,
@ -141,7 +141,7 @@ func (a *Technology) InstanceEdit(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewInstance()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewInstance()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.InstanceParams{
ID: form.Convert(),
PatentID: form.PatentID, Territory: form.Territory, Title: form.Title, Company: form.Company,
@ -161,7 +161,7 @@ func (a *Technology) InstanceShelf(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewInstance()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewInstance()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Shelf(form.Convert(), form.Status)
api.APIResponse(err)(c)
}
@ -173,7 +173,7 @@ func (a *Technology) InstanceDelete(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewInstance()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewInstance()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Delete(form.Convert())
api.APIResponse(err)(c)
}
@ -187,7 +187,7 @@ func (a *Technology) Paper(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := technology2.NewPaper()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
data, err := technology2.NewPaper()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
List(form.Title, form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}
@ -199,7 +199,7 @@ func (a *Technology) PaperAdd(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewPaper()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewPaper()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.PaperParams{
Title: form.Title, Ext: form.Ext, Author: form.Author, PublishAt: form.PublishAt,
Keyword: form.Keyword, Tags: form.Tags, Remark: form.Remark,
@ -216,7 +216,7 @@ func (a *Technology) PaperEdit(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewPaper()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewPaper()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.PaperParams{
ID: form.Convert(), Title: form.Title, Ext: form.Ext, Author: form.Author, PublishAt: form.PublishAt,
Keyword: form.Keyword, Tags: form.Tags, Remark: form.Remark,
@ -231,7 +231,7 @@ func (a *Technology) PaperDelete(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewPaper()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewPaper()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Delete(form.Convert())
api.APIResponse(err)(c)
}
@ -245,7 +245,7 @@ func (a *Technology) Patent(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := technology2.NewPatent()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
data, err := technology2.NewPatent()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
List(form.Title, form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}
@ -257,7 +257,7 @@ func (a *Technology) PatentDetail(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := technology2.NewPatent()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
data, err := technology2.NewPatent()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Detail(form.Convert())
api.APIResponse(err, data)(c)
}
@ -269,7 +269,7 @@ func (a *Technology) PatentAdd(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewPatent()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewPatent()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.PatentParams{
Title: form.Title, IPCCode: form.IPCCode, CPCCode: form.CPCCode, ApplyCode: form.ApplyCode,
ApplyName: form.ApplyName, ApplyAddress: form.ApplyAddress, ApplyZipCode: form.ApplyZipCode,
@ -288,7 +288,7 @@ func (a *Technology) PatentEdit(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewPatent()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewPatent()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.PatentParams{
ID: form.Convert(), Title: form.Title, IPCCode: form.IPCCode, CPCCode: form.CPCCode,
ApplyCode: form.ApplyCode, ApplyName: form.ApplyName, ApplyAddress: form.ApplyAddress,
@ -305,7 +305,7 @@ func (a *Technology) PatentDelete(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewPatent()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewPatent()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Delete(form.Convert())
api.APIResponse(err)(c)
}
@ -319,7 +319,7 @@ func (a *Technology) Demand(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := technology2.NewDemand()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
data, err := technology2.NewDemand()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
List(form.Status, form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}
@ -331,7 +331,7 @@ func (a *Technology) DemandDetail(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := technology2.NewDemand()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
data, err := technology2.NewDemand()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Detail(form.Convert())
api.APIResponse(err, data)(c)
}
@ -343,7 +343,7 @@ func (a *Technology) DemandAdd(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewDemand()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewDemand()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.DemandParams{
Title: form.Title, Introduce: form.Introduce, Name: form.Name, Mobile: form.Mobile, Deadline: form.Deadline,
Industry: form.Industry, Kinds: form.Kinds, Area: form.Area, Budget: form.Budget, BudgetMode: form.BudgetMode,
@ -365,7 +365,7 @@ func (a *Technology) DemandEdit(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewDemand()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewDemand()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.DemandParams{
ID: form.Convert(), Title: form.Title, Introduce: form.Introduce, Name: form.Name, Mobile: form.Mobile, Deadline: form.Deadline,
Industry: form.Industry, Kinds: form.Kinds, Area: form.Area, Budget: form.Budget, BudgetMode: form.BudgetMode,
@ -385,7 +385,7 @@ func (a *Technology) DemandDelete(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewDemand()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewDemand()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Delete(form.Convert())
api.APIResponse(err)(c)
}
@ -399,7 +399,7 @@ func (a *Technology) Topic(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := technology2.NewTopic()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
data, err := technology2.NewTopic()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
List(form.Status, form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}
@ -411,7 +411,7 @@ func (a *Technology) TopicDetail(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := technology2.NewTopic()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
data, err := technology2.NewTopic()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Detail(form.Convert())
api.APIResponse(err, data)(c)
}
@ -423,7 +423,7 @@ func (a *Technology) TopicAdd(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewTopic()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewTopic()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.TopicParams{Title: form.Title, Emcee: form.Emcee, Mechanism: form.Mechanism, Code: form.Code,
BeginAt: form.BeginAt, FinishAt: form.FinishAt, Amount: form.Amount, Source: form.Source, Kind: form.Kind,
Keywords: form.Keywords})
@ -439,7 +439,7 @@ func (a *Technology) TopicEdit(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewTopic()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewTopic()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.TopicParams{ID: form.Convert(), Title: form.Title, Emcee: form.Emcee, Mechanism: form.Mechanism,
Code: form.Code, BeginAt: form.BeginAt, FinishAt: form.FinishAt, Amount: form.Amount, Source: form.Source,
Kind: form.Kind, Keywords: form.Keywords})
@ -453,7 +453,7 @@ func (a *Technology) TopicDelete(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewTopic()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewTopic()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Delete(form.Convert())
api.APIResponse(err)(c)
}
@ -467,7 +467,7 @@ func (a *Technology) Equipment(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
data, err := technology2.NewEquipment()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
data, err := technology2.NewEquipment()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
List(form.Title, form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}
@ -479,7 +479,7 @@ func (a *Technology) EquipmentAdd(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewEquipment()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewEquipment()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.EquipmentParams{Title: form.Title, Research: form.Research, Describe: form.Describe})
api.APIResponse(err)(c)
}
@ -493,7 +493,7 @@ func (a *Technology) EquipmentEdit(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewEquipment()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewEquipment()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(&technology2.EquipmentParams{ID: form.Convert(), Title: form.Title, Research: form.Research, Describe: form.Describe})
api.APIResponse(err)(c)
}
@ -505,7 +505,7 @@ func (a *Technology) EquipmentDelete(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := technology2.NewEquipment()(api.GetSession()(c).(*service.SessionEnterprise), api.GetLocal()(c).(string)).
err := technology2.NewEquipment()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Delete(form.Convert())
api.APIResponse(err)(c)
}

View File

@ -1,10 +1,10 @@
package api
import (
user2 "SciencesServer/app/api/enterprise/controller/user"
"SciencesServer/app/api/enterprise/controller/user"
"SciencesServer/app/basic/api"
"SciencesServer/app/basic/config"
"SciencesServer/app/service"
"SciencesServer/app/session"
"github.com/gin-gonic/gin"
)
@ -32,17 +32,30 @@ type (
}
)
func (a *User) Info(c *gin.Context) {
data := user2.NewInstance()(api.GetSession()(c).(*service.SessionEnterprise)).Info()
func (*User) Info(c *gin.Context) {
data := user.NewInstance()(api.GetSession()(c).(*session.Enterprise)).Info()
api.APISuccess(data)
}
func (a *User) Detail(c *gin.Context) {
data, err := user2.NewInstance()(api.GetSession()(c).(*service.SessionEnterprise)).Detail()
func (*User) Detail(c *gin.Context) {
data, err := user.NewInstance()(api.GetSession()(c).(*session.Enterprise)).Detail()
api.APIResponse(err, data)(c)
}
func (a *User) SettledCompany(c *gin.Context) {
func (*User) BindMobile(c *gin.Context) {
form := &struct {
Mobile string `json:"mobile" form:"mobile" binding:"required"`
Captcha string `json:"captcha" form:"captcha" binding:"required"`
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
err := user.NewInstance()(api.GetSession()(c).(*session.Enterprise)).BindMobile(form.Mobile, form.Captcha)
api.APIResponse(err)(c)
}
func (*User) SettledCompany(c *gin.Context) {
form := &struct {
userSettledForm
}{}
@ -50,14 +63,14 @@ func (a *User) SettledCompany(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := user2.NewSettled()(api.GetSession()(c).(*service.SessionEnterprise)).Company(&user2.SettledParams{
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Company(&user.SettledParams{
ID: form.Convert(), Image: form.FilterImageURL(), Name: form.Name, Code: form.Code,
Area: form.Area, Introduce: form.Introduce, Industry: form.Industry, Keywords: form.Keywords,
}, nil)
api.APIResponse(err)(c)
}
func (a *User) SettledExpert(c *gin.Context) {
func (*User) SettledExpert(c *gin.Context) {
form := &struct {
userSettledForm
config.IdentityForExpert
@ -66,14 +79,14 @@ func (a *User) SettledExpert(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := user2.NewSettled()(api.GetSession()(c).(*service.SessionEnterprise)).Expert(&user2.SettledParams{
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Expert(&user.SettledParams{
ID: form.Convert(), Area: form.Area, Introduce: form.Introduce, Industry: form.Industry,
Keywords: form.Keywords,
}, &form.IdentityForExpert)
api.APIResponse(err)(c)
}
func (a *User) SettledResearch(c *gin.Context) {
func (*User) SettledResearch(c *gin.Context) {
form := &struct {
userSettledForm
config.IdentityForResearch
@ -82,14 +95,14 @@ func (a *User) SettledResearch(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := user2.NewSettled()(api.GetSession()(c).(*service.SessionEnterprise)).Research(&user2.SettledParams{
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Research(&user.SettledParams{
ID: form.Convert(), Image: form.FilterImageURL(), Name: form.Name, Code: form.Code,
Area: form.Area, Introduce: form.Introduce, Industry: form.Industry, Keywords: form.Keywords,
}, &form.IdentityForResearch)
api.APIResponse(err)(c)
}
func (a *User) SettledLaboratory(c *gin.Context) {
func (*User) SettledLaboratory(c *gin.Context) {
form := &struct {
userSettledForm
config.IdentityForLaboratory
@ -98,14 +111,14 @@ func (a *User) SettledLaboratory(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := user2.NewSettled()(api.GetSession()(c).(*service.SessionEnterprise)).Laboratory(&user2.SettledParams{
err := user.NewSettled()(api.GetSession()(c).(*session.Enterprise)).Laboratory(&user.SettledParams{
ID: form.Convert(), Image: form.FilterImageURL(), Name: form.Name, Code: form.Code,
Area: form.Area, Introduce: form.Introduce, Industry: form.Industry, Keywords: form.Keywords,
}, &form.IdentityForLaboratory)
api.APIResponse(err)(c)
}
func (a *User) SwitchIdentity(c *gin.Context) {
func (*User) SwitchIdentity(c *gin.Context) {
form := &struct {
Identity int `json:"identity" form:"identity" binding:"required"`
}{}
@ -113,38 +126,35 @@ func (a *User) SwitchIdentity(c *gin.Context) {
api.APIFailure(err.(error))(c)
return
}
err := user2.NewInstance()(api.GetSession()(c).(*service.SessionEnterprise)).SwitchIdentity(form.Identity)
err := user.NewInstance()(api.GetSession()(c).(*session.Enterprise)).SwitchIdentity(form.Identity)
api.APIResponse(err)(c)
}
func (a *User) Back(c *gin.Context) {
data, err := user2.NewBank()(api.GetSession()(c).(*service.SessionEnterprise)).List()
func (*User) Back(c *gin.Context) {
data, err := user.NewBank()(api.GetSession()(c).(*session.Enterprise)).List()
api.APIResponse(err, data)
}
func (a *User) BackBind(c *gin.Context) {
func (*User) BackBind(c *gin.Context) {
form := new(userBankForm)
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
err := user2.NewBank()(api.GetSession()(c).(*service.SessionEnterprise)).Bind(&user2.BankParams{
Name: form.Name,
IDCard: form.IDCard,
BankCard: form.BackCard,
BankName: form.BackName,
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)
}
func (a *User) BackUnbind(c *gin.Context) {
func (*User) BackUnbind(c *gin.Context) {
form := new(api.IDStringForm)
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
err := user2.NewBank()(api.GetSession()(c).(*service.SessionEnterprise)).Unbind(form.Convert())
err := user.NewBank()(api.GetSession()(c).(*session.Enterprise)).Unbind(form.Convert())
api.APIResponse(err)
}