| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- package guangzuan
- import (
- "mtp2_if/global/app"
- "mtp2_if/global/e"
- "mtp2_if/logger"
- "mtp2_if/models"
- "net/http"
- "github.com/gin-gonic/gin"
- )
- // PriceCalc
- // @Summary 钻石价格计算器
- // @Produce json
- // @Security ApiKeyAuth
- // @Security LoginID
- // @Security Group
- // @Param zsshape query int true "形状 - 1:BR(圆形) 2:PS(异形)"
- // @Param zscolor query string true "颜色(D-M)"
- // @Param zsclarity query string true "净度"
- // @Param weight query float64 true "重量"
- // @Param rate query float64 true "汇率"
- // @Param discount query float64 false "折扣(%), 方向(加:10, 减:-10 )"
- // @Success 200 {array} models.Gzrapaportprice
- // @Failure 500 {object} app.Response
- // @Router /Guangzuan/PriceCalc [get]
- // @Tags 广钻
- func PriceCalc(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.Gzrapaportprice{}
- a.DoBindReq(&m)
- a.DoGetDataI(&m)
- }
- // GzCertAddressConfig
- // @Summary Rapaport最新报价表(广钻)
- // @Produce json
- // @Security ApiKeyAuth
- // @Security LoginID
- // @Security Group
- // @Success 200 {array} models.Gzcertaddressconfig
- // @Failure 500 {object} app.Response
- // @Router /Guangzuan/GzCertAddressConfig [get]
- // @Tags 广钻
- func GzCertAddressConfig(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.Gzcertaddressconfig{}
- if d, err := m.GetAll(); err == nil {
- a.Gin.Response(http.StatusOK, e.SUCCESS, d)
- } else {
- logger.GetLogger().Errorf("query fail, %v", err)
- a.Gin.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
- }
- }
- // GzCertAddressParam
- // @Summary 钻石证书地址参数
- // @Produce json
- // @Security ApiKeyAuth
- // @Security LoginID
- // @Security Group
- // @Success 200 {array} models.Gzcertaddressparam
- // @Failure 500 {object} app.Response
- // @Router /Guangzuan/GzCertAddressParam [get]
- // @Tags 广钻
- func GzCertAddressParam(c *gin.Context) {
- a := app.GinUtils{Gin: app.Gin{C: c}}
- m := models.Gzcertaddressparam{}
- if d, err := m.GetAll(); err == nil {
- a.Gin.Response(http.StatusOK, e.SUCCESS, d)
- } else {
- logger.GetLogger().Errorf("query fail, %v", err)
- a.Gin.Response(http.StatusBadRequest, e.ERROR_QUERY_FAIL, nil)
- }
- }
|