- store lng and lat.
This commit is contained in:
@@ -284,8 +284,11 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
|||||||
return num, err
|
return num, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateStore(ctx *jxcontext.Context, store *model.Store, userName string) (id int, err error) {
|
func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (id int, err error) {
|
||||||
|
store := &storeExt.Store
|
||||||
existingID := store.ID
|
existingID := store.ID
|
||||||
|
storeExt.Lng = jxutils.StandardCoordinate2Int(storeExt.FloatLng)
|
||||||
|
storeExt.Lat = jxutils.StandardCoordinate2Int(storeExt.FloatLat)
|
||||||
dao.WrapAddIDCULDEntity(store, userName)
|
dao.WrapAddIDCULDEntity(store, userName)
|
||||||
store.ID = existingID
|
store.ID = existingID
|
||||||
if err = dao.CreateEntity(nil, store); err == nil {
|
if err = dao.CreateEntity(nil, store); err == nil {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ func (c *StoreController) UpdateStore() {
|
|||||||
// @router /CreateStore [post]
|
// @router /CreateStore [post]
|
||||||
func (c *StoreController) CreateStore() {
|
func (c *StoreController) CreateStore() {
|
||||||
c.callCreateStore(func(params *tStoreCreateStoreParams) (retVal interface{}, errCode string, err error) {
|
c.callCreateStore(func(params *tStoreCreateStoreParams) (retVal interface{}, errCode string, err error) {
|
||||||
store := &model.Store{}
|
store := &cms.StoreExt{}
|
||||||
if err = utils.UnmarshalUseNumber([]byte(params.Payload), store); err == nil {
|
if err = utils.UnmarshalUseNumber([]byte(params.Payload), store); err == nil {
|
||||||
retVal, err = cms.CreateStore(params.Ctx, store, params.Ctx.GetUserName())
|
retVal, err = cms.CreateStore(params.Ctx, store, params.Ctx.GetUserName())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user