Merge branch 'sxy' into dev
This commit is contained in:
commit
8629decdc0
File diff suppressed because it is too large
Load Diff
@ -7,8 +7,8 @@ import (
|
||||
fmt "fmt"
|
||||
math "math"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||
_ "github.com/mwitkow/go-proto-validators"
|
||||
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||
)
|
||||
|
||||
@ -89,13 +89,6 @@ func (this *BundleDetailResponseV2) Validate() error {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Bundle", err)
|
||||
}
|
||||
}
|
||||
for _, item := range this.SelectValueAddService {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("SelectValueAddService", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *OrderRecord) Validate() error {
|
||||
@ -207,9 +200,9 @@ func (this *ValueAddServiceDetailRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ValueAddServiceDetailResponse) Validate() error {
|
||||
if this.ValueAddServiceLang != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ValueAddServiceLang); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddServiceLang", err)
|
||||
if this.ValueAddService != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ValueAddService); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddService", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.8
|
||||
// - protoc v3.20.3
|
||||
// - protoc v5.29.2
|
||||
// source: pb/bundle.proto
|
||||
|
||||
package bundle
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"fonchain-fiee/pkg/middleware"
|
||||
"fonchain-fiee/pkg/service"
|
||||
"fonchain-fiee/pkg/service/bundle"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@ -21,11 +22,20 @@ func BundleRouter(r *gin.RouterGroup) {
|
||||
bundleClientRoute.POST("remove", bundle.DeleteBundle)
|
||||
bundleClientRoute.POST("bundle-list", bundle.BundleList)
|
||||
}
|
||||
bundleClientRouteV2 := bundleRoute.Group("system/v2")
|
||||
bundleClientRouteV2.POST("save", bundle.SaveBundleV2)
|
||||
bundleClientRouteV2.POST("update/shelfStatus", bundle.HandShelf)
|
||||
|
||||
bundleAppRoute = bundleAppRoute.Group("common")
|
||||
{
|
||||
bundleAppRoute.POST("bundle-list", bundle.BundleList)
|
||||
}
|
||||
bundleAppRouteV2 := bundleRoute.Group("common/v2")
|
||||
{
|
||||
bundleAppRouteV2.POST("bundle-list", bundle.BundleListV2)
|
||||
bundleAppRouteV2.POST("bundle-detail", bundle.BundleDetailV2)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,12 @@ func ValueAddBundleRouter(r *gin.RouterGroup) {
|
||||
bundleClientRoute.POST("list", bundle.ValueAddBundleList)
|
||||
bundleClientRoute.POST("detail", bundle.ValueAddBundleDetail)
|
||||
}
|
||||
bundleClientRouteV2 := valueAddBundleRoute.Group("system/v2")
|
||||
{
|
||||
bundleClientRouteV2.POST("save", bundle.SaveValueAddService)
|
||||
bundleClientRouteV2.POST("list", bundle.ValueAddServiceList)
|
||||
bundleClientRouteV2.POST("detail", bundle.ValueAddServiceDetail)
|
||||
}
|
||||
|
||||
valueAddBundleAppRoute = valueAddBundleAppRoute.Group("system")
|
||||
{
|
||||
|
@ -77,3 +77,66 @@ func BundleList(c *gin.Context) {
|
||||
|
||||
service.Success(c, res)
|
||||
}
|
||||
|
||||
func SaveBundleV2(c *gin.Context) {
|
||||
var req bundle.BundleProfile
|
||||
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
res, err := service.BundleProvider.SaveBundle(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
service.Success(c, res)
|
||||
}
|
||||
|
||||
func BundleListV2(c *gin.Context) {
|
||||
var req bundle.BundleListRequest
|
||||
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
res, err := service.BundleProvider.BundleListV2(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
service.Success(c, res)
|
||||
}
|
||||
func BundleDetailV2(c *gin.Context) {
|
||||
var req bundle.BundleDetailRequest
|
||||
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
res, err := service.BundleProvider.BundleDetailV2(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
service.Success(c, res)
|
||||
}
|
||||
func HandShelf(c *gin.Context) {
|
||||
var req bundle.HandShelfRequest
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
res, err := service.BundleProvider.HandShelf(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
}
|
||||
|
@ -67,3 +67,49 @@ func ValueAddBundleDetail(c *gin.Context) {
|
||||
|
||||
service.Success1(c, res.Msg, res)
|
||||
}
|
||||
|
||||
func SaveValueAddService(c *gin.Context) {
|
||||
var req bundle.ValueAddServiceLang
|
||||
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error1(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
res, err := service.BundleProvider.SaveValueAddService(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
}
|
||||
func ValueAddServiceList(c *gin.Context) {
|
||||
var req bundle.ValueAddServiceListRequest
|
||||
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error1(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
res, err := service.BundleProvider.ValueAddServiceList(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
}
|
||||
func ValueAddServiceDetail(c *gin.Context) {
|
||||
var req bundle.ValueAddServiceDetailRequest
|
||||
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error1(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
res, err := service.BundleProvider.ValueAddServiceDetail(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user