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

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

Loading…
Cancel
Save