-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
178 changed files
with
250 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.dd; | ||
|
||
import org.nutz.boot.NbApp; | ||
import org.nutz.ioc.loader.annotation.IocBean; | ||
|
||
@IocBean | ||
public class MainLauncher { | ||
|
||
public static void main(String[] args) { | ||
new NbApp().setMainClass(MainModule.class).setPrintProcDoc(true).run(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
package com.dd; | ||
|
||
import com.dd.setup.MySetup; | ||
import org.nutz.integration.shiro.ShiroSessionProvider; | ||
import com.dd.setup.InitSetup; | ||
import org.nutz.mvc.annotation.*; | ||
import org.nutz.mvc.ioc.provider.ComboIocProvider; | ||
import org.nutz.plugins.view.freemarker.FreemarkerViewMaker; | ||
|
||
@Modules(scanPackage = true) | ||
@SetupBy(MySetup.class) | ||
@SessionBy(ShiroSessionProvider.class) | ||
@SetupBy(InitSetup.class) | ||
//@SessionBy(ShiroSessionProvider.class) | ||
@Encoding(input = "UTF-8", output = "UTF-8") | ||
@IocBy(type = ComboIocProvider.class, | ||
args = {"*js", "ioc/", "*anno", "com.dd"}) | ||
//@Views(DDView.class) | ||
@Views(FreemarkerViewMaker.class) | ||
@Fail("json") | ||
public class MainModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.dd.controller; | ||
|
||
import com.dd.mvc.Response; | ||
import org.nutz.ioc.loader.annotation.IocBean; | ||
import org.nutz.lang.util.NutMap; | ||
import org.nutz.mvc.annotation.At; | ||
import org.nutz.mvc.annotation.Ok; | ||
|
||
@IocBean | ||
@At("/") | ||
public class IndexController { | ||
|
||
@At | ||
@Ok("fm:/login") | ||
public Object login(){ | ||
return NutMap.NEW(); | ||
} | ||
|
||
@At | ||
@Ok("fm:/chat") | ||
public Object chat(){ | ||
return NutMap.NEW(); | ||
} | ||
|
||
@At | ||
@Ok("fm:/find") | ||
public Object find(){ | ||
return Response.ok(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.dd.controller; | ||
|
||
import com.dd.mvc.Response; | ||
import org.apache.shiro.web.session.HttpServletSession; | ||
import org.nutz.ioc.impl.PropertiesProxy; | ||
import org.nutz.ioc.loader.annotation.Inject; | ||
import org.nutz.ioc.loader.annotation.IocBean; | ||
import org.nutz.lang.util.NutMap; | ||
import org.nutz.mvc.annotation.At; | ||
import org.nutz.mvc.annotation.Ok; | ||
|
||
import javax.servlet.http.HttpSession; | ||
|
||
@IocBean | ||
@At("/test") | ||
public class TestController { | ||
|
||
@Inject | ||
private PropertiesProxy conf; | ||
|
||
|
||
@At("/test") | ||
@Ok("json") | ||
public Object test(){ | ||
return NutMap.NEW().setv("test","test"); | ||
} | ||
|
||
|
||
@At("/test2") | ||
@Ok("fm:test") | ||
public Object test2(HttpSession servletSession){ | ||
servletSession.setAttribute("name","Wendal"); | ||
return Response.ok().setv("hello","hello"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
我擦.....