You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
643 B
30 lines
643 B
package store
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"recook/internal/back"
|
|
"recook/internal/dbc"
|
|
"recook/internal/model/store"
|
|
)
|
|
|
|
type storeInfo struct {
|
|
ID uint `json:"id"`
|
|
Name string `json:"name"` // 供应商名称
|
|
Address string `json:"address"` // 详细地址
|
|
}
|
|
|
|
func QueryStoreList(c *gin.Context) {
|
|
var list []store.Information
|
|
dbc.DB.Select("id, name, business_license_address").Find(&list)
|
|
|
|
array := make([]storeInfo, 0, 0)
|
|
for i := range list {
|
|
array = append(array, storeInfo{
|
|
ID: list[i].ID,
|
|
Name: list[i].Name,
|
|
Address: list[i].BusinessLicenseAddress,
|
|
})
|
|
}
|
|
back.Suc(c, "", array)
|
|
}
|