修改获取地区列表不验证权限
This commit is contained in:
parent
df565f243d
commit
7daf07f983
3
.gitignore
vendored
3
.gitignore
vendored
@ -17,4 +17,5 @@
|
||||
# vendor/
|
||||
.idea/
|
||||
.git/
|
||||
.DS_Store/
|
||||
.DS_Store/
|
||||
data/
|
||||
@ -27,6 +27,20 @@ func (b *Public) GetCaptcha(c *gin.Context) {
|
||||
|
||||
// Login 登陆
|
||||
func (b *Public) Login(c *gin.Context) {
|
||||
//orderService := service.OrderService{}
|
||||
//res, err := orderService.PdfToImg()
|
||||
//if err != nil {
|
||||
// responses.FailWithMessage(err.Error(), c)
|
||||
// return
|
||||
//}
|
||||
//
|
||||
//if res != true {
|
||||
// responses.FailWithMessage("错误", c)
|
||||
// return
|
||||
//}
|
||||
//responses.Ok(c)
|
||||
//return
|
||||
|
||||
var adminRequest requests.AdminRequest
|
||||
|
||||
if err := c.ShouldBind(&adminRequest.Login); err != nil {
|
||||
|
||||
@ -78,6 +78,22 @@ func publicRouter(r *gin.Engine, api controller.Api) {
|
||||
|
||||
// 登陆
|
||||
adminGroup.POST("/login", api.Public.Login)
|
||||
|
||||
// 基础数据
|
||||
basicGroup := adminGroup.Group("/basic")
|
||||
{
|
||||
// 地区管理-基础数据
|
||||
areaGroup := basicGroup.Group("/area")
|
||||
{
|
||||
// 获取地区列表
|
||||
areaGroup.GET("/list", api.Basic.Area.GetAreaList)
|
||||
|
||||
// 修改地区
|
||||
|
||||
// 新增地区
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// adminRouter 公共路由-验证权限
|
||||
@ -161,16 +177,16 @@ func basicRouter(r *gin.Engine, api controller.Api) {
|
||||
// 新增银行
|
||||
}
|
||||
|
||||
// 地区管理-基础数据
|
||||
areaGroup := basicGroup.Group("/area")
|
||||
{
|
||||
// 获取地区列表
|
||||
areaGroup.GET("/list", api.Basic.Area.GetAreaList)
|
||||
|
||||
// 修改地区
|
||||
|
||||
// 新增地区
|
||||
}
|
||||
//// 地区管理-基础数据
|
||||
//areaGroup := basicGroup.Group("/area")
|
||||
//{
|
||||
// // 获取地区列表
|
||||
// areaGroup.GET("/list", api.Basic.Area.GetAreaList)
|
||||
//
|
||||
// // 修改地区
|
||||
//
|
||||
// // 新增地区
|
||||
//}
|
||||
}
|
||||
|
||||
// privateRouter 私有路由-验证权限
|
||||
|
||||
@ -363,7 +363,7 @@ func (r *OrderService) PdfToImg() (bool, error) {
|
||||
continue
|
||||
}
|
||||
|
||||
if orderPrescriptionFile.IsConvertedPdf != 1 {
|
||||
if orderPrescriptionFile.IsConvertedPdf == 1 {
|
||||
continue
|
||||
}
|
||||
|
||||
@ -371,38 +371,45 @@ func (r *OrderService) PdfToImg() (bool, error) {
|
||||
|
||||
PrescriptionImgOssPath := strings.TrimLeft(orderPrescriptionFile.PrescriptionImgOssPath, "/")
|
||||
|
||||
// 下载处方pdf到本地
|
||||
// 下载处方图片到本地
|
||||
local, err := aliyun.GetObjectToLocal(PrescriptionImgOssPath,
|
||||
"/Users/wucongxing/Desktop/work/go/hospital-admin-api/data/bak/"+OrderPrescriptionId+".jpg")
|
||||
"/Users/wucongxing/Desktop/work/go/hospital-admin-api/data/bak/img/"+OrderPrescriptionId+".jpg")
|
||||
if err != nil || !local {
|
||||
return false, err
|
||||
}
|
||||
|
||||
//pdfPath := "/Users/wucongxing/Desktop/work/go/hospital-admin-api/data/" + OrderPrescriptionId + ".pdf"
|
||||
//outputDir := "/Users/wucongxing/Desktop/work/go/hospital-admin-api/data/img"
|
||||
//
|
||||
//if err := utils.ConvertPDFToImages(pdfPath, outputDir, OrderPrescriptionId+".jpg"); err != nil {
|
||||
// return false, err
|
||||
//}
|
||||
//
|
||||
//// 修改为已转换
|
||||
//// 开始事务
|
||||
//tx := global.Db.Begin()
|
||||
//defer func() {
|
||||
// if r := recover(); r != nil {
|
||||
// tx.Rollback()
|
||||
// }
|
||||
//}()
|
||||
//
|
||||
//data := make(map[string]interface{})
|
||||
//data["is_converted_pdf"] = 1
|
||||
//err = orderPrescriptionFileDao.EditOrderPrescriptionFileById(tx, orderPrescriptionFile.PrescriptionFileId, data)
|
||||
//if err != nil {
|
||||
// tx.Rollback()
|
||||
// return false, err
|
||||
//}
|
||||
//
|
||||
//tx.Commit()
|
||||
// 下载处方pdf到本地
|
||||
local, err = aliyun.GetObjectToLocal(orderPrescriptionFile.PrescriptionPdfOssPath,
|
||||
"/Users/wucongxing/Desktop/work/go/hospital-admin-api/data/bak/pdf/"+OrderPrescriptionId+".pdf")
|
||||
if err != nil || !local {
|
||||
return false, err
|
||||
}
|
||||
|
||||
pdfPath := "/Users/wucongxing/Desktop/work/go/hospital-admin-api/data/bak/pdf/" + OrderPrescriptionId + ".pdf"
|
||||
outputDir := "/Users/wucongxing/Desktop/work/go/hospital-admin-api/data/img"
|
||||
|
||||
if err := utils.ConvertPDFToImages(pdfPath, outputDir, OrderPrescriptionId+".jpg"); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
// 修改为已转换
|
||||
// 开始事务
|
||||
tx := global.Db.Begin()
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
tx.Rollback()
|
||||
}
|
||||
}()
|
||||
|
||||
data := make(map[string]interface{})
|
||||
data["is_converted_pdf"] = 1
|
||||
err = orderPrescriptionFileDao.EditOrderPrescriptionFileById(tx, orderPrescriptionFile.PrescriptionFileId, data)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return false, err
|
||||
}
|
||||
|
||||
tx.Commit()
|
||||
}
|
||||
|
||||
return true, nil
|
||||
|
||||
@ -14,6 +14,14 @@ mysql:
|
||||
max-idle-cons: 5
|
||||
max-open-cons: 20
|
||||
debug: true
|
||||
# host: 'cd-cdb-evnp3feu.sql.tencentcdb.com'
|
||||
# username: root
|
||||
# password: 'sKptsVOiTf6m3lt_'
|
||||
# port: 63976
|
||||
# db-name: export
|
||||
# max-idle-cons: 5
|
||||
# max-open-cons: 20
|
||||
# debug: true
|
||||
|
||||
log:
|
||||
file-path: "./log/"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user