feat: 对齐 Waffo 包年/永久结账与客户端席位 API

同步 OpsXShell 档位定价与 Waffo 商品映射,补齐 checkout/webhook/设备列表契约,便于桌面端购买与满席释放。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Logan.LiandCursor committed 2026-08-12 11:42:56 +08:00
1 parent 4ae318335c
commit 95405de119
14 files changed
+958 -155

No files matched your search

@@ -66,6 +66,16 @@ func (s *ProductService) GetByID(id uint) (*dto.ProductResponse, error) {
return &resp, nil
}
// GetByCode 根据产品编码获取产品 // Logan.Li
func (s *ProductService) GetByCode(code string) (*dto.ProductResponse, error) {
var product model.Product
if err := s.db.Where("code = ?", code).First(&product).Error; err != nil {
return nil, errors.New("产品不存在")
}
resp := toProductResponse(product)
return &resp, nil
}
// Create 创建产品 // Logan.Li
func (s *ProductService) Create(req dto.ProductCreate) (*dto.ProductResponse, error) {
// 检查 code 唯一性 // Logan.Li