Menu.setParentID(...) 수정

master
mjkhan21 1 year ago
parent 9c92c58d05
commit 6d56115d4f

@ -7,6 +7,7 @@ import java.util.List;
import cokr.xit.foundation.AbstractEntity; import cokr.xit.foundation.AbstractEntity;
import cokr.xit.foundation.Assert; import cokr.xit.foundation.Assert;
import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.UserInfo;
import cokr.xit.foundation.data.Convert;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
/** /**
@ -46,8 +47,8 @@ public class Menu extends AbstractEntity {
/**id . /**id .
* @param id id * @param id id
*/ */
public void setId(Integer id) { public void setId(Object id) {
this.id = id; this.id = Convert.toInt(id);
} }
/** . /** .
@ -131,8 +132,8 @@ public class Menu extends AbstractEntity {
/** id . /** id .
* @param parentID id * @param parentID id
*/ */
public void setParentID(Integer parentID) { public void setParentID(Object parentID) {
this.parentID = parentID; this.parentID = parentID != null ? Convert.toInt(parentID) : null;
} }
/** . /** .
@ -180,8 +181,8 @@ public class Menu extends AbstractEntity {
/** . /** .
* @param sortOrder * @param sortOrder
*/ */
public void setSortOrder(int sortOrder) { public void setSortOrder(Object sortOrder) {
this.sortOrder = sortOrder; this.sortOrder = Convert.toInt(sortOrder);
} }
/** . /** .

@ -35,12 +35,8 @@ public interface MenuMapper extends AbstractMapper {
* </ul> * </ul>
*/ */
default boolean insertMenu(Menu menu) { default boolean insertMenu(Menu menu) {
if (menu == null) return false; return menu != null
&& insertMenu(params().set("menu", menu)) > 0;
DataObject params = params()
.set("menu", menu)
.set("currentUser", currentUser());
return insertMenu(params) > 0;
} }
/** . /** .
@ -61,12 +57,8 @@ public interface MenuMapper extends AbstractMapper {
* </ul> * </ul>
*/ */
default boolean updateMenu(Menu menu) { default boolean updateMenu(Menu menu) {
if (menu == null) return false; return menu != null
&& updateMenu(params().set("menu", menu)) > 0;
DataObject params = params()
.set("menu", menu)
.set("currentUser", currentUser());
return updateMenu(params) > 0;
} }
/** . /** .

Loading…
Cancel
Save