- store lng and lat.

This commit is contained in:
gazebo
2018-10-30 22:37:53 +08:00
parent 47d6c6cf13
commit 0e7285efbd
2 changed files with 5 additions and 2 deletions

View File

@@ -284,8 +284,11 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
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
storeExt.Lng = jxutils.StandardCoordinate2Int(storeExt.FloatLng)
storeExt.Lat = jxutils.StandardCoordinate2Int(storeExt.FloatLat)
dao.WrapAddIDCULDEntity(store, userName)
store.ID = existingID
if err = dao.CreateEntity(nil, store); err == nil {

View File

@@ -80,7 +80,7 @@ func (c *StoreController) UpdateStore() {
// @router /CreateStore [post]
func (c *StoreController) CreateStore() {
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 {
retVal, err = cms.CreateStore(params.Ctx, store, params.Ctx.GetUserName())
}