feat: get all plans and improvement

This commit is contained in:
ericprd
2025-02-24 20:18:09 +08:00
parent 3b2321d5db
commit d492f3ce44
11 changed files with 87 additions and 11 deletions
+5 -4
View File
@@ -5,13 +5,14 @@ import (
"github.com/google/uuid"
)
func (s *SubsPlan) Create(code string) error {
spec := &subscribeplandomain.SubscribePlan{
func (s *SubsPlan) Create(spec subscribeplandomain.SubscribePlanReq) error {
data := &subscribeplandomain.SubscribePlan{
ID: uuid.New(),
Code: code,
Code: spec.Code,
Name: spec.Name,
}
if err := s.DB.Create(&spec).Error; err != nil {
if err := s.DB.Create(&data).Error; err != nil {
return err
}