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