OperService.class.php】的更多相关文章

<?php class OperSerVice{ public function getResult($num1,num2,oper){ switch($oper){ case "+": return $num1+$num2; break; case "-": return $num1-$num2; break; case "*": return $num1*$num2; break; case return $num1/$num2; br…
先创建注解 OperInfo @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited public @interface OperInfo { public String description() default "";//操作说明 } 然后创建AOP的切面类 LogAspect public class LogAspect {…
<?php require_once "OperSerVice.class.php"; //接受三个数 //isset if(!isset($_REQUEST['NUM1'])){ $num1=$_REQUEST['NUM1'];} if(!isset($_REQUEST['NUM2'])){ $num2=$_REQUEST['NUM2'];} if(!isset($_REQUEST['oper'])){ $oper=$_REQUEST[;OPER'];} //创建对象 $Ope…