package Ġcn . ber ber man . qrcode Ċ Ċ import Ġcom . i yan u ade le kan . kan ary . core . K an ary Controller Ċ import Ġcom . i yan u ade le kan . kan ary . helpers . http . request . done Ċ import Ġcom . i yan u ade le kan . kan ary . helpers . http . response . send Ċ import Ġcom . i yan u ade le kan . kan ary . helpers . http . response . with Status Ċ import Ġorg . eclipse . jetty . server . Request Ċ import Ġorg . eclipse . jetty . util . log . Std Err Log Ċ import Ġjava . util . logging . Logger Ċ import Ġjavax . servlet . http . HttpServletRequest Ċ import Ġjavax . servlet . http . HttpServletResponse Ċ Ċ class ĠQR Controller Ġ: ĠK an ary Controller () Ġ{ Ċ ĉ comp anion Ġobject Ġ{ Ċĉ ĉ private Ġval Ġlogger Ġ= ĠStd Err Log . getLogger ( QR Controller :: class . java ) Ċ ĉ } ĊĊ ĉ fun Ġshow ( base Request : ĠRequest , Ġrequest : ĠHttpServletRequest , Ġresponse : ĠHttpServletResponse ) Ġ{ Ċĉ ĉ response . contentType Ġ= Ġ" image / png ; charset = utf - 8 " Ċĉ ĉ val Ġcontent Ġ= Ġrequest . getParameter (" content ") Ċĉ ĉ if Ġ( content Ġ== Ġnull ) Ġ{ Ċĉĉ ĉ response . character Encoding Ġ= Ġ" UTF - 8 " Ċĉĉ ĉ response Ġwith Status Ġ 4 1 5 Ġsend Ġ" Please Ġinput Ġcontent Ġtext ! Ġ( e . g . Ġ: Ġ/ get ? content = xxx )" Ċĉĉ ĉ logger . warn (" è¯·æ±Ĥ å¤±è´¥ ! Ġ åľ°åĿĢ :${ request . remote Addr }") ĊĊĉĉ ĉ base Request . done () Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ QR Util . generate QR Code To Stream ( content Ġ= Ġcontent , ĠoutputStream Ġ= Ġresponse . output Stream ) Ċĉĉ ĉ Logger . get Anonymous Logger (). info (" è¯·æ±Ĥ æĪĲåĬŁ ! Ġ åľ°åĿĢ :${ request . remote Addr } Ġ åĨħå®¹ :$ content ") Ċĉĉ ĉ base Request . done () Ċĉ ĉ } Ċ ĉ } Ċ Ċ }