2022-12-17 20:47:35 +08:00
|
|
|
package api
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"crm/response"
|
|
|
|
|
"crm/service"
|
|
|
|
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
)
|
|
|
|
|
|
2023-01-28 21:17:31 +08:00
|
|
|
type CommonApi struct {
|
|
|
|
|
commonService *service.CommonService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewCommonApi() *CommonApi {
|
|
|
|
|
return &CommonApi{
|
|
|
|
|
commonService: service.NewCommonService(),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化数据库
|
|
|
|
|
func (c *CommonApi) InitDatabase(context *gin.Context) {
|
|
|
|
|
errCode := c.commonService.InitDatabase()
|
|
|
|
|
response.Result(errCode, nil, context)
|
2022-12-17 20:47:35 +08:00
|
|
|
}
|